package com.zmzncs.shop.module.shop.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zmzncs.shop.module.shop.pojo.shoporder.ShopOrder;
import com.zmzncs.shop.module.shop.pojo.shoporder.ShopOrderDTO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zmzncs.shop.module.shop.pojo.shoporder.ShopOrderWriteOffForm;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * 商户-订单 Mapper 接口
 * </p>
 *
 * @author 高博文
 * @since 2021-05-25
 */
@Repository
@Mapper
public interface ShopOrderMapper extends BaseMapper<ShopOrder> {

      /** 分页 */
      IPage<ShopOrderDTO> list(Page page);

      /** 详情 */
      ShopOrderDTO getById(Long id);

      /**根据核销码查询商户订单详情*/
      ShopOrderDTO getByWriteOffCode(String writeOffCode);

      /**首页-今日收入*/
      String todayRevenue(Long shopId);

      /**首页-收入详情-商品核销收入*/
      String writeOffRevenue(@Param("shopId") Long shopId, @Param("dateType") Integer dateType);

      /**首页-收入详情-引流投入*/
      String invest(@Param("shopId") Long shopId, @Param("dateType") Integer dateType);

      /**每月收益*/
      Double getShopOrderIncome(@Param("shopId") Long shopId,@Param("month") Integer month);

      /**首页-核销记录*/
      IPage<ShopOrderDTO> getWriteOffPage(Page page,@Param("form") ShopOrderWriteOffForm form);
}
